﻿using ShanNiang.Hosting.Enumerate;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ShanNiang.Hosting
{
    /// <summary>
    /// API 异常
    /// </summary>
    public class ApiException : Exception
    {
        /// <summary>
        /// 构造
        /// </summary>
        /// <param name="errorCode">错误编码</param>
        public ApiException(GlobalErrorCode errorCode, string? errorMessage = null) : base(errorMessage)
        {
            ErrorCode = errorCode;
            
        }
        /// <summary>
        /// 错误编码
        /// </summary>
        public GlobalErrorCode ErrorCode { get; set; }
    }
}
